package com.zhiyou100.blog.aciton.title;

import com.zhiyou100.blog.service.TitleService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author shkstart
 * @create 2021-10-25 14:54
 */
@WebServlet("/title/guanzhu")
public class TitleGuanzhuServlet extends HttpServlet {
    private TitleService service = new TitleService();

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {


    }

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String tid = request.getParameter("tid");
        String pageNum = request.getParameter("pageNum");
        service.updateTitleGuanZhu(Integer.parseInt(tid));

        //重新跳转的该页面刷新数据
        request.getRequestDispatcher("/title/query?pageNum=" + pageNum).forward(request, response);
    }
}
